Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: change order of arguments in add_event #270

Merged

Conversation

mauriciovasquezbernal
Copy link
Member

e4d8949 ("OpenTracing Bridge - Initial implementation (#211)") introduced
a new timestamp argument to the add_event method. This commit moves that
argument to be the last one because it is more common to have event attributes
than an explicitly timestamp.

e4d8949 ("OpenTracing Bridge - Initial implementation (open-telemetry#211)") introduced
a new timestamp argument to the add_event method. This commit moves that
argument to be the last one because it is more common to have event attributes
than an explicitly timestamp.
Copy link
Member

@c24t c24t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes LGTM, but adding a few lines to test_span_members pushed it over the threshold for pylint to raise a too-many-statements.

We may want to disable this check eventually, but I think pylint is right in this case: this test would benefit from being broken up.

Copy link
Member

@toumorokoshi toumorokoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on doing something to break up the tests vs removing the linting. But LGTM! Assuming that gets fixed approved.

@@ -75,7 +75,7 @@ def log_kv(self, key_values, timestamp=None):
event_timestamp = None

event_name = util.event_name_from_kv(key_values)
self._otel_span.add_event(event_name, event_timestamp, key_values)
self._otel_span.add_event(event_name, key_values, event_timestamp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd personally use explicit param names here, in order to be on the safe side (in case we change order in the future ;) )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually having the parameters by position could be good because it can be a reminder that if the position is changed something could break.

Copy link
Member

@c24t c24t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mauriciovasquezbernal, LGTM!

@c24t c24t merged commit d231c53 into open-telemetry:master Nov 5, 2019
c24t pushed a commit that referenced this pull request Nov 23, 2019
The flask integration has (only) two advantages over the plain WSGI middleware
approach:

- It can use the endpoint as span name (which is lower cardinality than the
  route; cf #270)
- It can set the http.route attribute.

In addition, it also has an easier syntax to enable (you don't have to know
about Flask.wsgi_app).
@mauriciovasquezbernal mauriciovasquezbernal deleted the mauricio/change_events_argument_order branch April 14, 2020 21:51
srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this pull request Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants